import datetime
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from applications.extensions import db


class Device(db.Model, UserMixin):
    __tablename__ = 'admin_device'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='设备ID')
    deviceName = db.Column(db.String(20), comment='设备名称')
    typeNum = db.Column(db.String(60), comment='设备型号')
    producer = db.Column(db.String(50), comment='制造商')
    warranty = db.Column(db.String(50), comment='保修期')
    enable = db.Column(db.Integer, default=1, comment='0是报废，1是可用')
    status = db.Column(db.Integer, default=1, comment='0是借出，1是在库')

    purchase_at = db.Column(db.DateTime, default=datetime.datetime.now, comment='购买日期')

